﻿// -------------------------------------------------------------------------
//    @FileName         :    NFServiceSkill.cpp
//    @Author           :    gaoyi
//    @Date             :    2025/1/16
//    @Email            :    445267987@qq.com
//    @Module           :    NFServiceSkill
//
// -------------------------------------------------------------------------

#include "NFServiceSkill.h"

#include <NFPlayer.h>
#include <NFSkillPart.h>
#include <NFComm/NFPluginModule/NFCheck.h>

bool NFServiceSkill::IsTransfer(NFPlayer* pPlayer)
{
    CHECK_NULL_RE_VAL(0, pPlayer, false);
    auto pSkillPart = pPlayer->GetPart<NFSkillPart>(PART_SKILL);
    CHECK_NULL_RE_VAL(pPlayer->GetRoleID(), pSkillPart, false);

    return pSkillPart->IsTransfer();
}

bool NFServiceSkill::IsAwake(NFPlayer* pPlayer)
{
    CHECK_NULL_RE_VAL(0, pPlayer, false);
    auto pSkillPart = pPlayer->GetPart<NFSkillPart>(PART_SKILL);
    CHECK_NULL_RE_VAL(pPlayer->GetRoleID(), pSkillPart, false);

    return pSkillPart->IsAwake();
}

int NFServiceSkill::GetTransferId(NFPlayer* pPlayer)
{
    CHECK_NULL_RE_VAL(0, pPlayer, 0);
    auto pSkillPart = pPlayer->GetPart<NFSkillPart>(PART_SKILL);
    CHECK_NULL_RE_VAL(pPlayer->GetRoleID(), pSkillPart, 0);

    return pSkillPart->GetTransferID();
}
